package com.joysuch.wwyt.edu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.joysuch.wwyt.core.bean.ResultDto;
import com.joysuch.wwyt.edu.bean.EduExamUserDto;
import com.joysuch.wwyt.edu.bean.EduSourceDto;
import com.joysuch.wwyt.edu.entity.EduExamRecord;
import com.joysuch.wwyt.edu.entity.EduTrainningRecordUser;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface EduExamRecordsMapper extends BaseMapper<EduExamRecord> {

    List<EduExamRecord> queryExamRecordsByuserId(Long userId, Date beginTime, Date endTime);

    IPage<EduExamRecord> selectRecords(Page<EduExamRecord> eduEamedues, @Param("userId") Long userId, @Param("departCode") String departCode, @Param("jobId") Long jobId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    List<EduExamRecord> selectExam(@Param("userId") Long userId, @Param("startTime")  Date startTime, @Param("endTime") Date endTime);

    /**
     * 根据考试id 查询考试记录
     * @param examId
     * @return
     */
    List<EduExamRecord> selectByExamId(@Param("examId")Long examId,@Param("userIds")List<Long> userIds);

    /**
     * 根据考试id集合查询
     * @param examIds
     * @return
     */
    List<ResultDto> examPassCountByExamIds(@Param("examIds")List<Long> examIds);

    List<EduSourceDto> queryPassScoreOfExamIds(@Param("examIds")List<Long> examIds);

    void addBatchMembers(@Param("eduExamUserDtoList") List<EduExamUserDto> eduExamUserDtoList);

    EduExamRecord selectByUserIdandExamId(@Param("userId") Long userId,@Param("id") Long id);

    EduExamRecord selectUserExamRecord(@Param("currentUserId") Long currentUserId, @Param("id") Long id);

}
